class SingleDog{

    init(){        
        return {name:'xxx'}
    }
}
const getSingleDog=((...args)=>{
        let instance = null
        return function(){
            // 判断自由变量是否为null
            if(!instance) {
                // 如果为null则new出唯一实例
                instance = new SingleDog()
            }
            return instance
        }
    })()
    
    const _instance = Symbol('instance')
   
  

let a=new getSingleDog()
let b=new getSingleDog()

console.log(a===b)